It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
gpointer data)
{
gchar *text;
- GdkColor color;
+ GdkRGBA color;
guint32 pixel = 0;
GdkPixbuf *pixbuf;
gtk_tree_model_get (tree_model, iter, COL_TEXT, &text, -1);
- if (gdk_color_parse (text, &color))
+ if (!text)
+ return;
+
+ if (gdk_rgba_parse (&color, text))
pixel =
- (color.red >> 8) << 24 |
- (color.green >> 8) << 16 |
- (color.blue >> 8) << 8;
+ ((gint)(color.red * 255)) << 24 |
+ ((gint)(color.green * 255)) << 16 |
+ ((gint)(color.blue * 255)) << 8 |
+ ((gint)(color.alpha * 255));
g_free (text);
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 24, 24);
+ pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 24, 24);
gdk_pixbuf_fill (pixbuf, pixel);
g_object_set (cell, "pixbuf", pixbuf, NULL);
#
# GDK header files for public installation (non-generated)
#
+#
gdk_public_h_sources = \
gdk.h \
gdkapplaunchcontext.h \
gdkcairo.h \
- gdkcolor.h \
gdkcursor.h \
gdkdevice.h \
gdkdevicemanager.h \
gdkvisual.h \
gdkwindow.h
+deprecated_h_sources = \
+ deprecated/gdkcolor.h
+
+gdk_h_sources = \
+ $(gdk_public_h_sources) \
+ $(deprecated_h_sources)
+
gdk_private_headers = \
gdkapplaunchcontextprivate.h \
gdkcursorprivate.h \
gdkvisualprivate.h \
gdkx.h
+deprecated_c_sources = \
+ deprecated/gdkcolor.c
+
gdk_c_sources = \
+ $(deprecated_c_sources) \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
- gdkcolor.c \
gdkcursor.c \
gdkdeprecated.c \
gdkdevice.c \
gdkinclude_HEADERS = $(gdk_public_h_sources) gdkenumtypes.h gdkversionmacros.h
nodist_gdkinclude_HEADERS = gdkconfig.h
+deprecatedincludedir = $(includedir)/gtk-3.0/gdk/deprecated
+deprecatedinclude_HEADERS = $(deprecated_h_sources)
+
common_sources = \
$(gdk_private_headers) \
$(gdk_c_sources) \
if HAVE_INTROSPECTION
introspection_files = \
- $(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources)) \
+ $(filter-out gdkkeysyms-compat.h, $(gdk_h_sources)) \
$(gdk_c_sources) \
gdkenumtypes.c \
gdkenumtypes.h
gdkenumtypes.h: stamp-gdkenumtypes.h
@true
-stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
+stamp-gdkenumtypes.h: $(gdk_h_sources) gdkenumtypes.h.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
- $(gdk_public_h_sources) ) >> xgen-geth \
+ $(gdk_h_sources) ) >> xgen-geth \
&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
&& rm -f xgen-geth \
&& echo timestamp > $(@F)
-gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
+gdkenumtypes.c: $(gdk_h_sources) gdkenumtypes.c.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
- $(gdk_public_h_sources) ) > xgen-getc \
+ $(gdk_h_sources) ) > xgen-getc \
&& cp xgen-getc gdkenumtypes.c \
&& rm -f xgen-getc
--- /dev/null
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#include "config.h"
+
+#include "gdkcolor.h"
+
+#include "gdkscreen.h"
+#include "gdkinternals.h"
+
+#include <time.h>
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
+/**
+ * SECTION:colors
+ * @Short_description: Manipulation of colors
+ * @Title: Colors
+ *
+ * A #GdkColor represents a color.
+ *
+ * When working with cairo, it is often more convenient
+ * to use a #GdkRGBA instead, and #GdkColor has been
+ * deprecated in favor of #GdkRGBA.
+ */
+
+
+/**
+ * gdk_color_copy:
+ * @color: a #GdkColor
+ *
+ * Makes a copy of a #GdkColor.
+ *
+ * The result must be freed using gdk_color_free().
+ *
+ * Returns: a copy of @color
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
+ */
+GdkColor*
+gdk_color_copy (const GdkColor *color)
+{
+ GdkColor *new_color;
+
+ g_return_val_if_fail (color != NULL, NULL);
+
+ new_color = g_slice_new (GdkColor);
+ *new_color = *color;
+ return new_color;
+}
+
+/**
+ * gdk_color_free:
+ * @color: a #GdkColor
+ *
+ * Frees a #GdkColor created with gdk_color_copy().
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
+ */
+void
+gdk_color_free (GdkColor *color)
+{
+ g_return_if_fail (color != NULL);
+
+ g_slice_free (GdkColor, color);
+}
+
+/**
+ * gdk_color_hash:
+ * @color: a #GdkColor
+ *
+ * A hash function suitable for using for a hash
+ * table that stores #GdkColors.
+ *
+ * Returns: The hash function applied to @color
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
+ */
+guint
+gdk_color_hash (const GdkColor *color)
+{
+ return ((color->red) +
+ (color->green << 11) +
+ (color->blue << 22) +
+ (color->blue >> 6));
+}
+
+/**
+ * gdk_color_equal:
+ * @colora: a #GdkColor
+ * @colorb: another #GdkColor
+ *
+ * Compares two colors.
+ *
+ * Returns: %TRUE if the two colors compare equal
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
+ */
+gboolean
+gdk_color_equal (const GdkColor *colora,
+ const GdkColor *colorb)
+{
+ g_return_val_if_fail (colora != NULL, FALSE);
+ g_return_val_if_fail (colorb != NULL, FALSE);
+
+ return ((colora->red == colorb->red) &&
+ (colora->green == colorb->green) &&
+ (colora->blue == colorb->blue));
+}
+
+G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
+ gdk_color_copy,
+ gdk_color_free)
+
+/**
+ * gdk_color_parse:
+ * @spec: the string specifying the color
+ * @color: (out): the #GdkColor to fill in
+ *
+ * Parses a textual specification of a color and fill in the
+ * @red, @green, and @blue fields of a #GdkColor.
+ *
+ * The string can either one of a large set of standard names
+ * (taken from the X11 `rgb.txt` file), or it can be a hexadecimal
+ * value in the form “\#rgb” “\#rrggbb”, “\#rrrgggbbb” or
+ * “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits of
+ * the red, green, and blue components of the color, respectively.
+ * (White in the four forms is “\#fff”, “\#ffffff”, “\#fffffffff”
+ * and “\#ffffffffffff”).
+ *
+ * Returns: %TRUE if the parsing succeeded
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
+ */
+gboolean
+gdk_color_parse (const gchar *spec,
+ GdkColor *color)
+{
+ PangoColor pango_color;
+
+ if (pango_color_parse (&pango_color, spec))
+ {
+ color->red = pango_color.red;
+ color->green = pango_color.green;
+ color->blue = pango_color.blue;
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+/**
+ * gdk_color_to_string:
+ * @color: a #GdkColor
+ *
+ * Returns a textual specification of @color in the hexadecimal
+ * form “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits
+ * representing the red, green and blue components respectively.
+ *
+ * The returned string can be parsed by gdk_color_parse().
+ *
+ * Returns: a newly-allocated text string
+ *
+ * Since: 2.12
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
+ */
+gchar *
+gdk_color_to_string (const GdkColor *color)
+{
+ PangoColor pango_color;
+
+ g_return_val_if_fail (color != NULL, NULL);
+
+ pango_color.red = color->red;
+ pango_color.green = color->green;
+ pango_color.blue = color->blue;
+
+ return pango_color_to_string (&pango_color);
+}
--- /dev/null
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GDK_COLOR_H__
+#define __GDK_COLOR_H__
+
+#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdk.h> can be included directly."
+#endif
+
+#include <cairo.h>
+#include <gdk/gdktypes.h>
+#include <gdk/gdkversionmacros.h>
+
+G_BEGIN_DECLS
+
+
+/**
+ * GdkColor:
+ * @pixel: For allocated colors, the pixel value used to
+ * draw this color on the screen. Not used anymore.
+ * @red: The red component of the color. This is
+ * a value between 0 and 65535, with 65535 indicating
+ * full intensity
+ * @green: The green component of the color
+ * @blue: The blue component of the color
+ *
+ * A #GdkColor is used to describe a color,
+ * similar to the XColor struct used in the X11 drawing API.
+ */
+struct _GdkColor
+{
+ guint32 pixel;
+ guint16 red;
+ guint16 green;
+ guint16 blue;
+};
+
+#define GDK_TYPE_COLOR (gdk_color_get_type ())
+
+GDK_DEPRECATED_IN_3_14
+GType gdk_color_get_type (void) G_GNUC_CONST;
+
+GDK_DEPRECATED_IN_3_14
+GdkColor *gdk_color_copy (const GdkColor *color);
+GDK_DEPRECATED_IN_3_14
+void gdk_color_free (GdkColor *color);
+
+GDK_DEPRECATED_IN_3_14
+guint gdk_color_hash (const GdkColor *color);
+GDK_DEPRECATED_IN_3_14
+gboolean gdk_color_equal (const GdkColor *colora,
+ const GdkColor *colorb);
+
+GDK_DEPRECATED_IN_3_14
+gboolean gdk_color_parse (const gchar *spec,
+ GdkColor *color);
+GDK_DEPRECATED_IN_3_14
+gchar * gdk_color_to_string (const GdkColor *color);
+
+
+G_END_DECLS
+
+#endif /* __GDK_COLOR_H__ */
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkapplaunchcontext.h>
#include <gdk/gdkcairo.h>
-#include <gdk/gdkcolor.h>
#include <gdk/gdkcursor.h>
#include <gdk/gdkdevice.h>
#include <gdk/gdkdevicemanager.h>
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
+#ifndef GDK_DISABLE_DEPRECATED
+#include <gdk/deprecated/gdkcolor.h>
+#endif
+
#undef __GDK_H_INSIDE__
#endif /* __GDK_H__ */
#endif
#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkcolor.h>
+#include <gdk/deprecated/gdkcolor.h>
#include <gdk/gdkrgba.h>
#include <gdk/gdkpixbuf.h>
#include <pango/pangocairo.h>
+++ /dev/null
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gdkcolor.h"
-
-#include "gdkscreen.h"
-#include "gdkinternals.h"
-
-#include <time.h>
-
-/**
- * SECTION:colors
- * @Short_description: Manipulation of colors
- * @Title: Colors
- *
- * A #GdkColor represents a color.
- *
- * When working with cairo, it is often more convenient
- * to use a #GdkRGBA instead.
- */
-
-
-/**
- * gdk_color_copy:
- * @color: a #GdkColor
- *
- * Makes a copy of a #GdkColor.
- *
- * The result must be freed using gdk_color_free().
- *
- * Returns: a copy of @color
- */
-GdkColor*
-gdk_color_copy (const GdkColor *color)
-{
- GdkColor *new_color;
-
- g_return_val_if_fail (color != NULL, NULL);
-
- new_color = g_slice_new (GdkColor);
- *new_color = *color;
- return new_color;
-}
-
-/**
- * gdk_color_free:
- * @color: a #GdkColor
- *
- * Frees a #GdkColor created with gdk_color_copy().
- */
-void
-gdk_color_free (GdkColor *color)
-{
- g_return_if_fail (color != NULL);
-
- g_slice_free (GdkColor, color);
-}
-
-/**
- * gdk_color_hash:
- * @color: a #GdkColor
- *
- * A hash function suitable for using for a hash
- * table that stores #GdkColors.
- *
- * Returns: The hash function applied to @color
- */
-guint
-gdk_color_hash (const GdkColor *color)
-{
- return ((color->red) +
- (color->green << 11) +
- (color->blue << 22) +
- (color->blue >> 6));
-}
-
-/**
- * gdk_color_equal:
- * @colora: a #GdkColor
- * @colorb: another #GdkColor
- *
- * Compares two colors.
- *
- * Returns: %TRUE if the two colors compare equal
- */
-gboolean
-gdk_color_equal (const GdkColor *colora,
- const GdkColor *colorb)
-{
- g_return_val_if_fail (colora != NULL, FALSE);
- g_return_val_if_fail (colorb != NULL, FALSE);
-
- return ((colora->red == colorb->red) &&
- (colora->green == colorb->green) &&
- (colora->blue == colorb->blue));
-}
-
-G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
- gdk_color_copy,
- gdk_color_free)
-
-/**
- * gdk_color_parse:
- * @spec: the string specifying the color
- * @color: (out): the #GdkColor to fill in
- *
- * Parses a textual specification of a color and fill in the
- * @red, @green, and @blue fields of a #GdkColor.
- *
- * The string can either one of a large set of standard names
- * (taken from the X11 `rgb.txt` file), or it can be a hexadecimal
- * value in the form “\#rgb” “\#rrggbb”, “\#rrrgggbbb” or
- * “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits of
- * the red, green, and blue components of the color, respectively.
- * (White in the four forms is “\#fff”, “\#ffffff”, “\#fffffffff”
- * and “\#ffffffffffff”).
- *
- * Returns: %TRUE if the parsing succeeded
- */
-gboolean
-gdk_color_parse (const gchar *spec,
- GdkColor *color)
-{
- PangoColor pango_color;
-
- if (pango_color_parse (&pango_color, spec))
- {
- color->red = pango_color.red;
- color->green = pango_color.green;
- color->blue = pango_color.blue;
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * gdk_color_to_string:
- * @color: a #GdkColor
- *
- * Returns a textual specification of @color in the hexadecimal
- * form “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits
- * representing the red, green and blue components respectively.
- *
- * The returned string can be parsed by gdk_color_parse().
- *
- * Returns: a newly-allocated text string
- *
- * Since: 2.12
- */
-gchar *
-gdk_color_to_string (const GdkColor *color)
-{
- PangoColor pango_color;
-
- g_return_val_if_fail (color != NULL, NULL);
-
- pango_color.red = color->red;
- pango_color.green = color->green;
- pango_color.blue = color->blue;
-
- return pango_color_to_string (&pango_color);
-}
+++ /dev/null
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GDK_COLOR_H__
-#define __GDK_COLOR_H__
-
-#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
-#error "Only <gdk/gdk.h> can be included directly."
-#endif
-
-#include <cairo.h>
-#include <gdk/gdktypes.h>
-#include <gdk/gdkversionmacros.h>
-
-G_BEGIN_DECLS
-
-
-/**
- * GdkColor:
- * @pixel: For allocated colors, the pixel value used to
- * draw this color on the screen. Not used anymore.
- * @red: The red component of the color. This is
- * a value between 0 and 65535, with 65535 indicating
- * full intensity
- * @green: The green component of the color
- * @blue: The blue component of the color
- *
- * A #GdkColor is used to describe a color,
- * similar to the XColor struct used in the X11 drawing API.
- */
-struct _GdkColor
-{
- guint32 pixel;
- guint16 red;
- guint16 green;
- guint16 blue;
-};
-
-#define GDK_TYPE_COLOR (gdk_color_get_type ())
-
-GDK_AVAILABLE_IN_ALL
-GType gdk_color_get_type (void) G_GNUC_CONST;
-
-GDK_AVAILABLE_IN_ALL
-GdkColor *gdk_color_copy (const GdkColor *color);
-GDK_AVAILABLE_IN_ALL
-void gdk_color_free (GdkColor *color);
-
-GDK_AVAILABLE_IN_ALL
-guint gdk_color_hash (const GdkColor *color);
-GDK_AVAILABLE_IN_ALL
-gboolean gdk_color_equal (const GdkColor *colora,
- const GdkColor *colorb);
-
-GDK_AVAILABLE_IN_ALL
-gboolean gdk_color_parse (const gchar *spec,
- GdkColor *color);
-GDK_AVAILABLE_IN_ALL
-gchar * gdk_color_to_string (const GdkColor *color);
-
-
-G_END_DECLS
-
-#endif /* __GDK_COLOR_H__ */
#endif
#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkdevice.h>
* as %FALSE), enumerations (can be specified by their name, nick or
* integer value), flags (can be specified by their name, nick, integer
* value, optionally combined with “|”, e.g. “GTK_VISIBLE|GTK_REALIZED”)
- * and colors (in a format understood by gdk_color_parse()). Pixbufs can
+ * and colors (in a format understood by gdk_rgba_parse()). Pixbufs can
* be specified as a filename of an image file to load. Objects can be
* referred to by their name and by default refer to objects declared
* in the local xml fragment and objects exposed via
}
break;
case G_TYPE_BOXED:
- if (G_VALUE_HOLDS (value, GDK_TYPE_COLOR))
+ if (G_VALUE_HOLDS (value, g_type_from_name ("GdkColor")))
{
GdkColor color = { 0, };
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (gdk_color_parse (string, &color))
g_value_set_boxed (value, &color);
else
string);
ret = FALSE;
}
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (G_VALUE_HOLDS (value, GDK_TYPE_RGBA))
{
*
* Deprecated: 3.4: Use #GtkCellRenderer:cell-background-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_CELL_BACKGROUND_GDK,
g_param_spec_boxed ("cell-background-gdk",
P_("Cell background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellRenderer:cell-background-rgba:
*
*
* Deprecated: 3.4: Use #GtkCellRendererText:background-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellRendererText:background-rgba:
*
* Deprecated: 3.4: Use #GtkCellRendererText:foreground-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_FOREGROUND_GDK,
g_param_spec_boxed ("foreground-gdk",
P_("Foreground color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellRendererText:foreground-rgba:
*
* Deprecated: 3.4: Use #GtkCellView:background-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (gobject_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellView:background-rgba:
*
*
* Deprecated: 3.4: Use #GtkColorButton:rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (gobject_class,
PROP_COLOR,
g_param_spec_boxed ("color",
P_("The selected color"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkColorButton:alpha:
gdk_rgba_parse (&color, "pink");
g_value_set_boxed (&value, &color);
}
- else if (pspec->value_type == GDK_TYPE_COLOR)
+ else if (pspec->value_type == g_type_from_name ("GdkColor"))
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GdkColor color;
gdk_color_parse ("pink", &color);
g_value_set_boxed (&value, &color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (pspec->value_type == GTK_TYPE_BORDER)
{
g_string_append (string, "none");
else
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
char *s = gdk_color_to_string (color);
+G_GNUC_END_IGNORE_DEPRECATIONS
g_string_append (string, s);
g_free (s);
}
rgba_value_parse,
rgba_value_print,
rgba_value_compute);
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
register_conversion_function (GDK_TYPE_COLOR,
color_value_parse,
color_value_print,
color_value_compute);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
register_conversion_function (GTK_TYPE_SYMBOLIC_COLOR,
symbolic_color_value_parse,
symbolic_color_value_print,
g_param_spec_boxed ("selection-box-color",
P_("Selection Box Color"),
P_("Color of the selection box"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
}
break;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
/* PangoAttrColor */
case PANGO_ATTR_FOREGROUND:
- if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
+ if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
value, &val, error))
{
color = g_value_get_boxed (&val);
attribute = pango_attr_strikethrough_color_new (color->red, color->green, color->blue);
}
break;
+
+G_GNUC_END_IGNORE_DEPRECATIONS
/* PangoAttrShape */
case PANGO_ATTR_SHAPE:
GdkColor color;
gchar *str;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
/* Reject non-color types for now */
if (pspec->value_type != GDK_TYPE_COLOR)
return FALSE;
+G_GNUC_END_IGNORE_DEPRECATIONS
+
priv = GTK_MODIFIER_STYLE (provider)->priv;
str = g_strdup_printf ("-%s-%s",
g_type_name (pspec->owner_type),
switch (property_id)
{
case PROP_COLOR_HASH:
- g_value_take_boxed (value,
- g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, (GDestroyNotify) gdk_color_free));
+ g_value_take_boxed (value, g_hash_table_new (g_str_hash, g_str_equal));
return;
default: ;
}
if ((g_value_type_transformable (G_TYPE_INT, value_type) &&
!(fundamental_type == G_TYPE_ENUM || fundamental_type == G_TYPE_FLAGS)) ||
g_value_type_transformable (G_TYPE_STRING, G_VALUE_TYPE (value)) ||
- g_value_type_transformable (GDK_TYPE_COLOR, G_VALUE_TYPE (value)))
+ g_value_type_transformable (GDK_TYPE_RGBA, G_VALUE_TYPE (value)))
{
if (priv->property_values[property_id - 1].source == GTK_SETTINGS_SOURCE_APPLICATION ||
!gdk_screen_get_setting (priv->screen, pspec->name, value))
GtkRcPropertyParser
_gtk_rc_property_parser_from_type (GType type)
{
- if (type == GDK_TYPE_COLOR)
+ if (type == g_type_from_name ("GdkColor"))
return gtk_rc_property_parse_color;
else if (type == GTK_TYPE_REQUISITION)
return gtk_rc_property_parse_requisition;
color->blue = style_color->blue / 65535.0;
color->alpha = 1;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_color_free (style_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
if (dest->font)
pango_font_description_free (dest->font);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (dest->pg_bg_color)
gdk_color_free (dest->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (dest->pg_bg_rgba)
gdk_rgba_free (dest->pg_bg_rgba);
if (src->font)
dest->font = pango_font_description_copy (src->font);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (src->pg_bg_color)
dest->pg_bg_color = gdk_color_copy (src->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (src->pg_bg_rgba)
dest->pg_bg_rgba = gdk_rgba_copy (src->pg_bg_rgba);
if (values->font)
pango_font_description_free (values->font);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (values->pg_bg_color)
gdk_color_free (values->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (values->pg_bg_rgba)
gdk_rgba_free (values->pg_bg_rgba);
if (dest->pg_bg_color)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_color_free (dest->pg_bg_color);
dest->pg_bg_color = NULL;
+G_GNUC_END_IGNORE_DEPRECATIONS
}
if (vals->pg_bg_rgba)
dest->pg_bg_rgba = gdk_rgba_copy (vals->pg_bg_rgba);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (vals->pg_bg_color)
dest->pg_bg_color = gdk_color_copy (vals->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
if (vals->font)
static gchar *
serialize_value (GValue *value)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (g_value_type_transformable (value->g_type, G_TYPE_STRING))
{
GValue text_value = G_VALUE_INIT;
{
g_warning ("Type %s is not serializable\n", g_type_name (value->g_type));
}
+G_GNUC_END_IGNORE_DEPRECATIONS
return NULL;
}
deserialize_value (const gchar *str,
GValue *value)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (g_value_type_transformable (G_TYPE_STRING, value->g_type))
{
GValue text_value = G_VALUE_INIT;
{
g_warning ("Type %s can not be deserialized\n", g_type_name (value->g_type));
}
+G_GNUC_END_IGNORE_DEPRECATIONS
return FALSE;
}
rgba.green = color->green / 65535.;
rgba.blue = color->blue / 65535.;
rgba.alpha = 1;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_color_free (color);
+G_GNUC_END_IGNORE_DEPRECATIONS
text_renderer->error_color = gdk_rgba_copy (&rgba);
}
display->total_width = MAX (layout->screen_width, layout->width) - display->left_margin - display->right_margin;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (style->pg_bg_color)
display->pg_bg_color = gdk_color_copy (style->pg_bg_color);
else
display->pg_bg_color = NULL;
+G_GNUC_END_IGNORE_DEPRECATIONS
if (style->pg_bg_rgba)
display->pg_bg_rgba = gdk_rgba_copy (style->pg_bg_rgba);
if (display->cursors)
g_array_free (display->cursors, TRUE);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (display->pg_bg_color)
gdk_color_free (display->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (display->pg_bg_rgba)
gdk_rgba_free (display->pg_bg_rgba);
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
g_param_spec_boxed ("foreground-gdk",
P_("Foreground color"),
P_("Foreground color as a GdkColor"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
g_param_spec_boxed ("paragraph-background-gdk",
P_("Paragraph background color"),
P_("Paragraph background color as a GdkColor"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
if (priv->values->pg_bg_rgba)
gdk_rgba_free (priv->values->pg_bg_rgba);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (priv->values->pg_bg_color)
gdk_color_free (priv->values->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
priv->values->pg_bg_rgba = NULL;
priv->values->pg_bg_color = NULL;
priv->values->pg_bg_rgba = gdk_rgba_copy (rgba);
copy_rgba_to_gdk_color (rgba, &color);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
priv->values->pg_bg_color = gdk_color_copy (&color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
/*
* Style properties
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boxed ("error-underline-color",
P_("Error underline color"),
P_("Color with which to draw error-indication underlines"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
+G_GNUC_END_IGNORE_DEPRECATIONS
/*
* Signals
P_("Make the expanders indented"),
TRUE,
GTK_PARAM_READABLE));
-
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boxed ("even-row-color",
P_("Even Row Color"),
P_("Color to use for odd rows"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
+G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("grid-line-width",
P_("Width, in pixels, between focus indicator and the widget 'box'"),
0, G_MAXINT, 1,
GTK_PARAM_READABLE | G_PARAM_DEPRECATED));
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (klass,
g_param_spec_boxed ("cursor-color",
P_("Cursor color"),
P_("Color with which to draw the secondary insertion cursor when editing mixed right-to-left and left-to-right text"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
+G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (klass,
g_param_spec_float ("cursor-aspect-ratio",
P_("Cursor line aspect ratio"),
FALSE,
GTK_PARAM_READABLE));
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* GtkWidget:link-color:
*
P_("Unvisited Link Color"),
P_("Color of unvisited links"),
GDK_TYPE_COLOR,
- GTK_PARAM_READABLE));
+ GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
/**
* GtkWidget:visited-link-color:
P_("Visited Link Color"),
P_("Color of visited links"),
GDK_TYPE_COLOR,
- GTK_PARAM_READABLE));
+ GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkWidget:wide-separators:
g_value_unset (&val);
}
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
color_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
g_value_unset (&val);
}
+G_GNUC_END_IGNORE_DEPRECATIONS
static void
font_modified (GtkFontChooser *fb, GParamSpec *pspec, ObjectProperty *p)
object, spec, G_CALLBACK (rgba_modified));
}
else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == GDK_TYPE_COLOR)
+ G_PARAM_SPEC_VALUE_TYPE (spec) == g_type_from_name ("GdkColor"))
{
prop_edit = gtk_color_chooser_widget_new ();
gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (prop_edit), FALSE);